﻿@model RH.Web.ViewModels.UserViewModel

@{    
    
}
@{  
    String pageTitle = "Edit User";
    if (Model == null || Model.ID > 0)
    {
        pageTitle = "Edit User";
    }    
    else
    {        
        pageTitle = "Add New User";
    }

    ViewBag.Title = Html.GetPageTitle(pageTitle); //RH.Web.Utility.WebUtil.GetPageTitle(pageTitle);
    Layout = "~/Views/Shared/_Layout.cshtml";
}
    
<h2>@pageTitle</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)    
    @*<fieldset>
        <legend>UserModel</legend>*@    
    if (Model == null)
    {
        @: @Html.ErrorMessageBox("Sorry! Requested User was not found for edit.")
    }
    else
    {                              
        <div class="GroupBox">
            <div class="GroupHeaderOverlay" style="width:125px;">User Information</div>
            @Html.HiddenFor(model => model.ID)

            <div class="editor-label">
                @Html.LabelFor(model => model.UserName)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.UserName)
                @Html.ValidationMessageFor(model => model.UserName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Password)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Password)
                @Html.ValidationMessageFor(model => model.Password)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.IsActive)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.IsActive)
                @Html.ValidationMessageFor(model => model.IsActive)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.CreatedOn)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.CreatedOn)
                @Html.ValidationMessageFor(model => model.CreatedOn)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.ModifiedOn)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.ModifiedOn)
                @Html.ValidationMessageFor(model => model.ModifiedOn)
            </div>

            <p>
                <input type="submit" value="Save" />
            </p>
        @*</fieldset>*@
        </div>
    }
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>



<div>
    
</div>
